/*
 * Copyright (C), 2014-2014, 联创车盟汽车服务有限公司
 * FileName: UserService.java
 * Author:   孙昊(sunhao@lianchuang.com)
 * Date:     2014年12月10日 上午9:42:36
 * Description:
 * History:
 * <author>   <time>    <version>    <desc>
 * 修改人姓名                 修改时间                 版本号                               描述
 */
package com.linkage.category.service;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.linkage.user.pojo.User;
import com.linkage.user.repository.UserRepositoryMapper;

/**
 * <br>
 *
 * @author 孙昊(sunhao@lianchuang.com)
 */
@Service
public class UserService5 {
    @Autowired
    private UserRepositoryMapper userRepository;

    public List<User> queryAll() {
        return this.userRepository.queryAll();
    }

    public void save(User user) {
        //user.setPkId(UUID.randomUUID().toString());
        this.userRepository.save(user);
    }

    public void update(User user) {
        this.userRepository.update(user);
    }

    public void delete(String userId) {
        this.userRepository.delete(userId);
    }

    public User loadOne(String userid) {
        return this.userRepository.findUserById(userid);
    }
    
    public User loadByLoginName(String username){
        return this.userRepository.findUserByName(username);
    }
}
